In a surgical robotic system, a robotic arm has a surgical tool attached to its distal end that is remotely operated by a surgeon. Applications include endoscopic surgery, which involves looking into a patient's body and performing surgery inside, for example the abdominal cavity, using endoscopes and other surgical tools that are attached to the ends of several robotic arms. The system gives the surgeon a close-up view of the surgery site, and also lets the surgeon operate the tool that is attached to the arm, all in real-time. The tool may be a gripper with jaws, a cutter, a video camera, or an energy emitter such as a laser used for coagulation. The tool is thus controlled in a precise manner with high dexterity in accordance with the surgeon manipulating a handheld controller. Some functions of the system such as control of the energy emitter may be assigned to a foot pedal controller that the surgeon manipulates with their foot.